using System;
using System.Collections.Generic;
using System.Text;

using Circo.Essentials.Persistence.Filters;

namespace Circo.Essentials.BusinessLogic.Views.Filters
{
    public class ViewStringFilter : ViewFilter
    {
        #region Constructores

        public ViewStringFilter()
        {
        }

        public ViewStringFilter(string propertyName, string value)
        {
            this.PropertyName = propertyName;
            this.Value = value;
        }

        public ViewStringFilter(string propertyName, string value, bool exactMatching)
        {
            this.PropertyName = propertyName;
            this.Value = value;
            this.ExactMatching = exactMatching;
        }

        public ViewStringFilter(string propertyName, string value, bool exactMatching, bool caseSensitive)
        {
            this.PropertyName = propertyName;
            this.Value = value;
            this.ExactMatching = exactMatching;
            this.CaseSensitive = caseSensitive;
        }
        
        #endregion Constructores

        private string _value;

        public string Value
        {
            get { return _value; }
            set { _value = value; }
        }

        private bool _exactMatching = false;

        public bool ExactMatching
        {
            get { return _exactMatching; }
            set { _exactMatching = value; }
        }


        private bool _caseSensitive = false;

        public bool CaseSensitive
        {
            get { return _caseSensitive; }
            set { _caseSensitive = value; }
        }
	
        public override EntityFilter MapToEntity()
        {
            return (new StringFilter(this.PropertyName, this.Value, this.ExactMatching, this.CaseSensitive));
        }

    }

}
